package com.example.system.convert;

import com.example.system.dto.DictDto;
import com.example.system.entity.Dict;
import com.example.system.entity.DictItem;
import com.example.system.vo.DictItemVo;
import com.example.system.vo.DictVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author 王令
 * @since 2022/10/28 20:58
 */
@Mapper
public interface DictConvert {

    DictConvert INSTANCE = Mappers.getMapper(DictConvert.class);

    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "tenantId", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    @Mapping(target = "deleteTime", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    Dict toDict(DictDto dictDto);

    DictVo toDictVo(Dict dict);

    List<DictItemVo> toDictItemVoList(List<DictItem> items);
}
